package com.ihome.android.market2.view;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ihome.android.academy.AppMgrActivity;
import com.ihome.android.academy.R;
import com.ihome.android.market2.frag.RecommAppFragment;
import com.ihome.android.util.log.UserBehaviorLog;
import com.ihome.android.util.log.UserBehaviorLog.NotifyType;
import com.ihome.android.util.log.UserBehaviorLog.UserBehavior;

/**
 * 自定义一个小标题信息
 * @author wm
 * @category 主要使用在测试的悦学堂
 * @date 2015-08-03
 */
public class SmallTitle extends LinearLayout implements View.OnClickListener {
	private LayoutInflater	mInflater;
	// 名称
	private TextView		title_name;
	//更多
	private TextView		more;	

	private RelativeLayout				rl_main;

	private RelativeLayout llNetAndTime;

	public SmallTitle(Context context) {
		super(context);
		mInflater = LayoutInflater.from(context);
		initial();
	}

	public SmallTitle(Context context, AttributeSet attrs) {
		super(context, attrs);
		mInflater = LayoutInflater.from(context);
		initial();
	}

	void initial() {
		View Temp = mInflater.inflate(R.layout.small_title, this);
		title_name = (TextView) Temp.findViewById(R.id.titleName);
		more = (TextView) Temp.findViewById(R.id.more);
		llNetAndTime = (RelativeLayout) Temp.findViewById(R.id.llNetAndTime);
		rl_main = (RelativeLayout) Temp.findViewById(R.id.rl_main);
		more.setOnClickListener(this);
	}

	@Override
	public void setOnKeyListener(OnKeyListener l) {
		super.setOnKeyListener(l);
		more.setOnKeyListener(l);
	}
	public void setNameTextSize(float textSize){
		title_name.setTextSize(textSize);
	}
	
	public int getId(){
		
		return R.id.more;
	}

	public void setBgImg(Drawable background){
		llNetAndTime.setBackground(background);
	}

	public void setMoreTextSize(float textSize){
		more.setTextSize(textSize);
	}

	public void setNameTextColor(int textColor){
		title_name.setTextSize(textColor);
	}

	public void setNameText(String content){
		title_name.setText(content);
	}
	public void setMoreTextColor(int textColor){
		more.setTextSize(textColor);
	}
	
	public TextView viewMoreFocus(){
		return more;
	}
	
	public RelativeLayout imgView(){
		return rl_main;
	}
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.more:
			break;
		default:
			break;
		}
	}

}
